﻿using System.Windows;

namespace Warehouse.Silverlight.Core.Infrastructure.ViewModels
{
    public abstract class ViewModel<TView> : ViewModel
    {
        public ViewModel()
        {
            this.Initialize();

            var elementView = this.View as FrameworkElement;
            if (elementView != null)
            {
                elementView.DataContext = this;
            }
        }

        public TView View { get; protected set; }
    }
}
